package com.cy.bean.scenic;

import java.io.Serializable;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.OneToOne;

import com.cy.bean.uploadfile.UploadFile;

/**
 * 景点
 * @author CY
 *
 */
@Entity
public class Scenic implements Serializable {

	private static final long serialVersionUID = -8098990873073394805L;

	/**
	 * 景点id
	 */
	@Id
	@GeneratedValue
	private Integer scenic_id;

	/**
	 * 景点名字
	 */
	@Column(length=30,nullable=false)
	private String scenic_name;
	
	/**
	 * 详细内容
	 */
	@Column(nullable=false)
	@Lob
	private String scenic_detailed;
	
	/**
	 * 是否显示
	 */
	@Column(nullable=false)
	private Boolean scenic_visible = true;

	/**
	 * 景点评分
	 */
	@Column(length=1,nullable=false)
	private Integer scenic_score = 5;
	
	/**
	 * 景点图片
	 */
	@OneToOne(cascade=CascadeType.REFRESH,optional=true)
	private UploadFile scenic_img;
	
	/**
	 * 简介
	 */
	@Column(length=200)
	private String scenic_intro;

	/**
	 * 类型
	 */
	@Column(length=10)
	private String scenic_type;

	public String getScenic_intro() {
		return scenic_intro;
	}

	public void setScenic_intro(String scenic_intro) {
		this.scenic_intro = scenic_intro;
	}

	public String getScenic_type() {
		return scenic_type;
	}

	public void setScenic_type(String scenic_type) {
		this.scenic_type = scenic_type;
	}

	public UploadFile getScenic_img() {
		return scenic_img;
	}

	public void setScenic_img(UploadFile scenic_img) {
		this.scenic_img = scenic_img;
	}

	public Integer getScenic_id() {
		return scenic_id;
	}

	public void setScenic_id(Integer scenic_id) {
		this.scenic_id = scenic_id;
	}

	public String getScenic_name() {
		return scenic_name;
	}

	public void setScenic_name(String scenic_name) {
		this.scenic_name = scenic_name;
	}

	public String getScenic_detailed() {
		return scenic_detailed;
	}

	public void setScenic_detailed(String scenic_detailed) {
		this.scenic_detailed = scenic_detailed;
	}

	public Boolean getScenic_visible() {
		return scenic_visible;
	}

	public void setScenic_visible(Boolean scenic_visible) {
		this.scenic_visible = scenic_visible;
	}

	public Integer getScenic_score() {
		return scenic_score;
	}

	public void setScenic_score(Integer scenic_score) {
		this.scenic_score = scenic_score;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((scenic_id == null) ? 0 : scenic_id.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Scenic other = (Scenic) obj;
		if (scenic_id == null) {
			if (other.scenic_id != null)
				return false;
		} else if (!scenic_id.equals(other.scenic_id))
			return false;
		return true;
	}

}
